#ifndef SIGUSR1_HANDLER_H_
#define SIGUSR1_HANDLER_H_

#include <signal.h>
#include <assert.h>
#include "EventHandler.h"

class SIGUSR1_Handler : public EventHandler {

	private:
		sig_atomic_t finPersonas;

	public:

		SIGUSR1_Handler () {
			this->finPersonas = 0;
		}

		virtual int handleSignal ( int signum ) {
			assert ( signum == SIGUSR1 );
			this->finPersonas = 1;
			return 0;
		}

		sig_atomic_t estaGenerandoPersonas () {
			return !this->finPersonas;
		}

};

#endif /* SIGUSR1_HANDLER_H_ */
